package lambda.test;

public class LambdaTest2 {
    public static void main(String[] args) {

        useStringHandler(nsg -> System.out.println("这是Lambda打印的"+nsg));
        useStringHandler(new StringHandler() {
            @Override
            public void printNessage(String nsg) {
                System.out.println("匿名内部类打印"+nsg);
            }
        });

    }

    public static void useStringHandler(StringHandler stringHandler){
        stringHandler.printNessage("ns");
    }
}

interface StringHandler{
    void printNessage(String nsg);
}